package com.itheima.mapper;

import com.itheima.pojo.Member;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.util.Date;
import java.util.List;

@Mapper
public interface MemberMapper {
    @Select("SELECT *from health_chuanzhi.t_member")
    List<Member> getAll();
    @Select("SELECT count(*)from health_chuanzhi.t_member where regTime=#{date}")
    Integer CountMemeberByDate(Date date);
    @Select("select count(*) from health_chuanzhi.t_member where t_member.regTime < #{localDate}")
    Integer selectMemberCountByMonth(LocalDate withDayOfMonth);
    @Select("SELECT count(*)from health_chuanzhi.t_member where regTime=#{date}")
    Integer getCountByDate(Date date);
    @Select("SELECT count(*)from health_chuanzhi.t_member")
    Integer getAllCount();
    @Select("select  count(*)from health_chuanzhi.t_member WHERE regTime>=#{monthBeginStr}")
    Integer getCountByMonth(String monthBeginStr);
    @Select("select  count(*)from health_chuanzhi.t_member WHERE regTime>=#{weekBeginStr}")
    Integer getCountByWeek(String weekBeginStr);
}
